import { createApp } from 'vue';
import App from './App.vue';
import pinia from './stores';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css'; // 引入 Element Plus 样式
import router from './router';

// SVG 图标注册插件
import 'virtual:svg-icons-register';

// 自定义 Icon 组件
import Icon from './components/icon/index.vue';
import ZbAiSuport from './components/zb-ai/suport.vue';
import ZbAiForm from './components/zb-ai/form.vue';
import ZbAiAudio from './components/zb-ai/audio.vue';
import ZbAiBtn from './components/zb-ai/btn.vue';
import ZbAiFormTitle from './components/zb-ai/form-title.vue';
import ZbAiLoading from './components/zb-ai/loading.vue';
import ZbAiHistory from './components/zb-ai/result-history.vue';
import ZbAiResultJob from './components/zb-ai/result-job.vue';
import ZbAiResultPrompt1 from './components/zb-ai/result-prompt1.vue';
import ZbAiResultImage from './components/zb-ai/result-image.vue';
import ZbAiResultTop from './components/zb-ai/result-top.vue';
import ZbAiSilder from './components/zb-ai/silder.vue';
import ZbAiTalk1 from './components/zb-ai/talk1.vue';
import ZbLoginPup from './components/zb-login/pup.vue';
import ZbLoginBindmobile from './components/zb-login/bindmobile.vue';
import ZbLogin from './components/zb-login/index.vue';
import ZbLoginInfo from './components/zb-login/info.vue';
import ZbLoginJob from './components/zb-login/job.vue';
import ZbLoginMy from './components/zb-login/my.vue';
import ZbBack from './components/zb-back/index.vue';
import ZbDelItem from './components/zb-del-item/index.vue';
import ZbScroll from './components/zb-scroll/index.vue';
import ZbMarkdown from './components/zb-markdown/index.vue';
import ZbAddress from './components/zb-address/index.vue';
import ZbIconOpen from './components/zb-icon/open.vue';
import ZbAiResultHistory from './components/zb-ai/result-history.vue';

// 导入 Element Plus 的图标组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue';

const app = createApp(App);

// 使用 Pinia 和 Router
app.use(pinia);
app.use(ElementPlus);
app.use(router);

// 全局注册自定义组件
app.component('ZbAiResultHistory', ZbAiResultHistory);
app.component('ZbAddress', ZbAddress);
app.component('ZbIconOpen', ZbIconOpen);
app.component('ZbMarkdown', ZbMarkdown);
app.component('ZbScroll', ZbScroll);
app.component('ZbDelItem', ZbDelItem);
app.component('ZbLoginBindmobile', ZbLoginBindmobile);
app.component('ZbLogin', ZbLogin);
app.component('ZbLoginInfo', ZbLoginInfo);
app.component('ZbLoginJob', ZbLoginJob);
app.component('ZbLoginMy', ZbLoginMy);
app.component('Icon', Icon);
app.component('ZbAiSuport', ZbAiSuport);
app.component('ZbAiForm', ZbAiForm);
app.component('ZbAiAudio', ZbAiAudio);
app.component('ZbAiBtn', ZbAiBtn);
app.component('ZbAiFormTitle', ZbAiFormTitle); // 修正了这里的名称
app.component('ZbAiLoading', ZbAiLoading);
app.component('ZbAiHistory', ZbAiHistory);
app.component('ZbAiResultJob', ZbAiResultJob);
app.component('ZbAiResultPrompt1', ZbAiResultPrompt1);
app.component('ZbAiResultImage', ZbAiResultImage);
app.component('ZbAiResultTop', ZbAiResultTop);
app.component('ZbAiSilder', ZbAiSilder);
app.component('ZbAiTalk1', ZbAiTalk1);
app.component('ZbLoginPup', ZbLoginPup);
app.component('ZbBack', ZbBack);

// 全局注册 Element Plus 图标组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.mount('#app');